package com.sg.dto.integration.app;

import com.sg.common.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @desc TargetContentDto
 * @使用场景
 */
@Data
public class TargetContentDto extends BaseDto implements Serializable {

    /**
     * 目标内容ID
     */
    @ApiModelProperty("目标内容ID")
    private String tagetContentId;

    /**
     * 目标内容名称
     */
    @ApiModelProperty("目标内容名称")
    private String targetContentName;

    /**
     * 对象名称
     */
    @ApiModelProperty("对象名称")
    private String objectName;

    /**
     * 指标ID
     */
    @ApiModelProperty("指标ID")
    private String objectiveId;

    /**
     * 冗余指标业务类型 NUMBER_GROWTH:数量增长型 NUMBER_DECLINE:数量降幅型 PERCENTAGE_GROWTH:百分比增长型 PERCENTAGE_DECLINE:百分比降幅型 PROGRESS:进度型 RATIO_GROWTH:比率增长型 RATIO_DECLINE:比率降幅型 SUBJECTIVE_QUALITATIVE:主观定性
     */
    @ApiModelProperty("冗余指标业务类型")
    private String targetValueType;

    /**
     * 通用编码标识
     */
    @ApiModelProperty("通用编码标识")
    private String comCode;

    /**
     * 内容表主键ID
     */
    @ApiModelProperty("内容表主键ID")
    private String entityId;

    /**
     * 当前内容标识
     */
    @ApiModelProperty("当前内容标识")
    private String currentContentCode;

    /**
     * 关联目标内容类型编码 TARGET:目标 TARGET_CATEGORY:目标分类 OBJECTIVE:指标
     */
    @ApiModelProperty("关联目标内容类型编码")
    private String targetCycleContentTypeCode;

    /**
     * 关联目标内容ID
     */
    @ApiModelProperty("关联目标内容ID")
    private String targetCycleContentId;

    /**
     * 冗余目标ID
     */
    @ApiModelProperty("冗余目标ID")
    private String targetId;

    /**
     * 冗余评价模板ID
     */
    @ApiModelProperty("冗余评价模板ID")
    private String evaluationTemplateId;

    /**
     * 操作时间
     */
    @ApiModelProperty("操作时间")
    private Date operateTime;

    /**
     * 被评对象目标周期标识
     */
    @ApiModelProperty("被评对象目标周期标识")
    private String evaObjTargetCycleCode;

    /**
     * 目标周期简称
     */
    @ApiModelProperty("目标周期简称")
    private String cyclelAlias;

    /**
     * 被评对象目标周期ID
     */
    @NotNull(message = "被评对象目标周期ID不能为空")
    @ApiModelProperty("被评对象目标周期ID")
    private String evaObjTargetCycleId;

    /**
     * 排序
     */
    @ApiModelProperty("排序")
    private Long orderNumber;

    /**
     * 部门排序
     */
    @ApiModelProperty("部门排序")
    private Long dutyBodyOrderNum;

    /**
     * 个人排序
     */
    @ApiModelProperty("个人排序")
    private Long personalOrderNumber;

    /**
     * 权重排序
     */
    @ApiModelProperty("权重排序")
    private Long weightOrderNumber;

    /**
     * 虚拟组织下部门ID
     */
    @ApiModelProperty("虚拟组织下部门ID")
    private String deptId;

    /**
     * 负责人就职记录ID
     */
    @ApiModelProperty("负责人就职记录ID")
    private String personLiableInductionRecordId;

    /**
     * 主管就职记录ID
     */
    @ApiModelProperty("主管就职记录ID")
    private String directorInductionRecordId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TargetContentDto that = (TargetContentDto) o;
        return (
                tagetContentId == that.tagetContentId &&
                        targetContentName == that.targetContentName &&
                        objectName == that.objectName &&
                        objectiveId == that.objectiveId &&
                        targetValueType == that.targetValueType &&
                        comCode == that.comCode &&
                        entityId == that.entityId &&
                        currentContentCode == that.currentContentCode &&
                        targetCycleContentTypeCode == that.targetCycleContentTypeCode &&
                        targetCycleContentId == that.targetCycleContentId &&
                        targetId == that.targetId &&
                        evaluationTemplateId == that.evaluationTemplateId &&
                        operateTime == that.operateTime &&
                        evaObjTargetCycleCode == that.evaObjTargetCycleCode &&
                        cyclelAlias == that.cyclelAlias &&
                        evaObjTargetCycleId == that.evaObjTargetCycleId &&
                        orderNumber == that.orderNumber &&
                        dutyBodyOrderNum == that.dutyBodyOrderNum &&
                        personalOrderNumber == that.personalOrderNumber &&
                        weightOrderNumber == that.weightOrderNumber &&
                        deptId == that.deptId &&
                        personLiableInductionRecordId == that.personLiableInductionRecordId &&
                        directorInductionRecordId == that.directorInductionRecordId
        );
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                super.hashCode(),
                tagetContentId,
                targetContentName,
                objectName,
                objectiveId,
                targetValueType,
                comCode,
                entityId,
                currentContentCode,
                targetCycleContentTypeCode,
                targetCycleContentId,
                targetId,
                evaluationTemplateId,
                operateTime,
                evaObjTargetCycleCode,
                cyclelAlias,
                evaObjTargetCycleId,
                orderNumber,
                dutyBodyOrderNum,
                personalOrderNumber,
                weightOrderNumber,
                deptId,
                personLiableInductionRecordId,
                directorInductionRecordId
        );
    }

}
